package com.koala.learn.threadlearn.charter4;

import lombok.SneakyThrows;

/**
 * @Description TODO
 * @Date 2022/2/28 0:05
 * @Created by koala
 */

public class HouseWork implements Runnable {

    private final Long time;

    private final String msg;

    public HouseWork(Long time, String msg) {
        this.time = time;
        this.msg = msg;
    }

    @SneakyThrows
    @Override
    public void run() {
        Thread.sleep(time);
        System.out.println(Thread.currentThread().getName() + " will do " + msg + " it will waste " + time + " second");
    }
}
